<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 *  Home Class  
 *  
 * @package CMS v2.0 
 * @subpackage News  
 * @author Vui Nguyen - 09/04/2013
 * @link http://joomlavui.info
 */
class Admin extends CI_Controller {

    /**
     * Contrust class
     *  
     * @access public 
     */
    public function __construct() {
		
        parent::__construct();
		$this->load->helper('url');		
        $this->load->library('smarty3', '', 'smarty');
        $this->load->library('captcha');
        $this->load->library('session');
        $this->load->library('email');
        
        $this->load->model('db_user_model');
        $this->db_user_model		= new db_user_model();
        $this->load->model('db_item_model');
        $this->db_item_model		= new db_item_model();
        $this->load->model('db_game_model');
        $this->db_game_model		= new db_game_model();
    }

    public function index() {
        $user = $this->session->userdata('user_info');
        if(!$user || $user[0]->ugid!=6)
            redirect('home');
        
        //lấy item mới đc đăng ký gửi
        $data['newitem'] = $this->db_item_model->getItem(array("trans_order"=>1,"confirm_order"=>0));
        //cộng trừ item giao dịch hợp lệ
        $data['trans-item'] = $this->db_item_model->getItem(array("trans_order"=>1,"confirm_order"=>1));
        
        $this->smarty->assign("user_info", $user);
        $this->smarty->assign(array("data"=>$data,"db_game_model"=>$this->db_game_model));
        $this->smarty->view('template/frontend/admin/01_admin','content');
        $this->smarty->display('template/frontend/home'); 
    }	   
}

/* End of file admin/cpanel.php */
/* Location: ./system/application/controllers/admin/cpanel.php */